<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>爱帮诊</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/Public/assets/i/favicon.png">
    <link rel="stylesheet" href="/Public/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="/Public/assets/css/app.css">
    <link rel="stylesheet" href="/Public/css/dici.css">
    <style>
        .yl-table td {
            border: solid 2px #F2F2F2;
        }

        .header-1{
            background-color:#42AD84;color: #fff;
        }
        .dv-w{
            background-color: #fff;
        }
        .am-tabs-d2 .am-tabs-nav > .am-active a {
            font-size: 16px;
            color: #42AD84;
        }
        .am-tabs-d2 .am-tabs-nav a {
            color: #6f6d6d;
            font-size: 16px;
        }
        .am-tabs-d2 .am-tabs-nav > .am-active {
            position: relative;
            background-color: #fff;
            border-bottom: 1px solid #42AD84
        }

        .am-tabs-d2 .am-tabs-nav > .am-active:after {
            position: absolute;
            width: 0;
            height: 0;
            bottom: 0;
            left: 50%;
            margin-left: -5px;
            border: 6px solid transparent;
            content: "";
            z-index: 1;
            /* border-bottom-color: #0e90d2 */
        }
        .li-1{
            background-color: #fff;
            border-bottom: 1px solid #c3c3c3;
        }
        .input-1{
            width: 100%;border: none;padding: 10px 0 10px 10px;outline:none
        }

        .a-c{
            color: #fff;
        }
    </style>
</head>
<body style="background-color: #EFEFEF;">
<!-- Header -->
<header data-am-widget="header" class="am-header am-header-default header-1">
    <div class="am-g">
        <div class="am-u-sm-4"><a href="#" onclick="javascript:history.go(-1);" class="a-c"><</a></div>
        <div class="am-u-sm-4" style="text-align: center;">登录</div>
        <div class="am-u-sm-4" style="text-align: right;">
            <!--<a href="<?php echo U('User/regPage');?>" class="a-c">注册</a>-->
        </div>
    </div>
</header>

<!--内容列表-->
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 dv-w" style="margin: 0;">
    <ul class="am-tabs-nav am-cf dv-w">
        <!--<li class="am-active li-1"><a href="[data-tab-panel-0]">密码登录</a></li>-->
        <li class="li-1"><a href="[data-tab-panel-1]">验证码登录</a></li>
    </ul>
    <div class="am-tabs-bd" style="border: 0;">
        <!--<div data-tab-panel-0 class="am-tab-panel" style="padding: 0;">-->
            <!--<div class="am-g">-->
                <!--<div class="am-u-sm-2">-->
                    <!--<img src="/Public/img/wp/login-1.jpg" class="dc-img" style="padding-top: 5px;">-->
                <!--</div>-->
                <!--<div class="am-u-sm-10">-->
                    <!--<input type="number" id="phone" class="input-1" placeholder="请输入11位手机号"/>-->
                <!--</div>-->
            <!--</div>-->
            <!--<hr style="margin: 0;"/>-->
            <!--<div class="am-g">-->
                <!--<div class="am-u-sm-2">-->
                    <!--<img src="/Public/img/wp/login-2.jpg" class="dc-img" style="padding-top: 5px;">-->
                <!--</div>-->
                <!--<div class="am-u-sm-10">-->
                    <!--<input type="password" id="pwd" class="input-1" placeholder="请输入密码"/>-->
                <!--</div>-->
            <!--</div>-->
            <!--<hr style="margin:0 0 1rem 0;"/>-->
            <!--<div style="text-align: center;">-->
            <!--<button type="button" id="pwd-login" class="am-btn am-btn-default am-radius" style="width: 90%;color: #222;margin-bottom: 1rem;">立即登录</button>-->
            <!--</div>-->
            <!--<p style="text-align: right;"><a href="<?php echo U('User/forgetPwdPage');?>">忘记密码？</a></p>-->
        <!--</div>-->
        <div data-tab-panel-1 class="am-tab-panel am-active">
            <div class="am-g">
                <div class="am-u-sm-2">
                    <img src="/Public/img/wp/login-1.jpg" class="dc-img" style="padding-top: 5px;">
                </div>
                <div class="am-u-sm-10">
                    <input type="number" id="phone2" class="input-1" placeholder="请输入11位手机号"/>
                </div>
            </div>
            <hr style="margin: 0;"/>
            <div class="am-g">
                <div class="am-u-sm-2">
                    <img src="/Public/img/wp/login-2.jpg" class="dc-img" style="padding-top: 5px;">
                </div>
                <div class="am-u-sm-6">
                    <input type="number" id="smscode" class="input-1" placeholder="请输入验证码"/>
                </div>
                <div class="am-u-sm-4">
                    <button type="button" id="sms-btn" class="am-btn am-btn-default am-radius" style="outline:none;">发送验证码</button>
                </div>
            </div>
            <hr style="margin:0 0 1rem 0;"/>
            <div style="text-align: center;">
                <button type="button" id="sms-login" class="am-btn am-btn-default am-radius" style="width: 90%;color: #222;margin-bottom: 1rem;">立即登录</button>
            </div>
        </div>
    </div>
</div>
<!--end-->

<script src="/Public/assets/js/jquery.min.js"></script>
<script src="/Public/assets/js/amazeui.min.js"></script>
<script>
    var second = 60;
    var sendTime = function () {
        if (second == 0) {
            $('#sms-btn').attr('disabled', 'false');
            $('#sms-btn').value = "发送验证码";
            second = 60;
            return false;
        }
        $('#sms-btn').attr('disabled', 'true');
        $('#sms-btn').css("font-size", 12);
        $('#sms-btn').text("请在" + second + "秒内输入");
        second--;
        setTimeout(function () {
            sendTime()
        }, 1000)
    }
    var sendMsg = function () {
        //判断手机号
        var phone2 = $('#phone2').val();
        if(phone2.length == 0){
            alert("请输入手机号");
            return false;
        }

        console.log(phone2);

        //发送验证码
        $.ajax({
            url:"<?php echo U('User/sendMsg');?>",
            type:"post",
            data:{phone:phone2,type:2},
            dataType:"json",
            success:function (res) {
                if(res.code != 0){
                    alert(res.msg);
                    return false;
                }
                sendTime();
            }
        })
    }
    $('#sms-btn').click(sendMsg);

//密码登录
    $('#pwd-login').click(function () {
        var phone = $("#phone").val();
        var pwd = $("#pwd").val();

        if(phone.length == 0){
            alert("请输入手机号");
            return false;
        }
        if(pwd.length == 0){
            alert("请输入密码");
            return false;
        }
        $.ajax({
            url:"<?php echo U('User/pwdLogin');?>",
            type:"post",
            data:{phone:phone,pwd:pwd},
            dataType:"json",
            success:function (res) {
                if(res.code !=0){
                    alert(res.msg);
                    return false;
                }
                location.href = "/index.php/Home/User/../User/wode";
            }
        })
    });

    //短信登录
    $('#sms-login').click(function () {
        var phone2 = $("#phone2").val();
        var smscode = $("#smscode").val();

        if(phone2.length == 0){
            alert("请输入手机号");
            return false;
        }
        if(smscode.length == 0){
            alert("请输入验证码");
            return false;
        }
        $.ajax({
            url:"<?php echo U('User/smsLogin');?>",
            type:"post",
            data:{phone:phone2,smscode:smscode},
            dataType:"json",
            success:function (res) {
                if(res.code !=0){
                    alert(res.msg);
                    return false;
                }
                location.href = "/index.php/Home/User/../User/wode";
            }
        })
    });

</script>
</body>
</html>